/*
 * Equipe.java
 *
 * Created on 23 de Janeiro de 2007, 03:08
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */

package controller.SGCA;

/**
 *
 * @author wldutra
 */
public class Equipe {
    
    private RegNegocio rn;
    private String idEquipe;
    private String sigla;
    private String nome;
    private String responsavel_1;
    private String responsavel_2;
    private String status;
    
    /** Creates a new instance of InserirCliente */
    public Equipe() {
        rn = new RegNegocio();
    }    

    public void setIdEquipe(String idEquipe) {
        this.idEquipe = idEquipe;
    }

    public void setSigla(String sigla) {
        this.sigla = sigla;
    }

    public void setNome(String nome) {
        this.nome = nome;
    }

    public void setResponsavel_1(String responsavel_1) {
        this.responsavel_1 = responsavel_1;
    }

    public void setResponsavel_2(String responsavel_2) {
        this.responsavel_2 = responsavel_2;
    }

    public void setStatus(String status) {
        this.status = status;
    }
    
    
    public void setUrl( String url ){
        rn.setUrlString(url);
    }
    
    public void setDrv( String drv ){
        rn.setConDriver(drv);
    }
    
    public String getQry(){
        return rn.getQry();
    }
    
    public int getInserir(){
        return rn.exeQuery(
                "INSERT INTO Equipe (" +
                "sigla," +
                "nome," +
                "responsavel_1," +
                "responsavel_2," +
                "status) VALUES (" +
                rn.devStr(sigla) + "," +
                rn.devStr(nome) + "," +
                rn.devStr(responsavel_1) + "," +
                rn.devStr(responsavel_2) + "," +
                rn.devStr(status) + ")");
    }
    
    public int getAlterar(){
        return rn.exeQuery( "UPDATE Equipe SET " +
                "sigla = " + rn.devStr(sigla) + "," +
                "nome = " + rn.devStr(nome) + "," +
                "responsavel_1 = " + rn.devStr(responsavel_1) + "," +
                "responsavel_2 = " + rn.devStr(responsavel_2) + "," +
                "status = " + rn.devStr( status) + 
                " WHERE idEquipe = " + rn.devStr(idEquipe));
    }
      
}
